<template>
    <section class="main">
        <div class="section" v-for="(connectData, index) in connectDatas" :key="index">
            <onvif :xaddr="connectData.xaddr" :readonly="true" :user="connectData.user" :pass="connectData.pass" :_width="640" :_height="480"
                :reConnect="true" class="onvif" @connect="connect" />
        </div>
    </section>
</template>
<script>
import onvif from "comp/onvif.vue";
export default {
    name: "List",
    components: {
        onvif,
    },
    data() {
        return {
            connectDatas: [
                {
                    xaddr: "172.16.16.70",
                    user: "admin",
                    pass: "zl@123456",
                },
                {
                    xaddr: "172.16.16.71",
                    user: "admin",
                    pass: "zl@123456",
                },
                {
                    xaddr: "172.16.16.70",
                    user: "admin",
                    pass: "zl@123456",
                },
                {
                    xaddr: "172.16.16.71",
                    user: "admin",
                    pass: "zl@123456",
                },
            ]
        }
    },
    mounted() { },
    created() { },
    methods: {
        connect() {
            window.dispatchEvent(new Event('resize'))
        },
        close(msg) {
            window.dispatchEvent(new Event('resize'))
        },
        error(error) {
            window.dispatchEvent(new Event('resize'))
        },
    }
}
</script>
<style scoped lang="scss">
@import "~css/login.scss";

.main {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-start;
    align-items: flex-start;
    .section {
        width: 640px;
        height: 400px;
        flex: 33.3%;
        max-width: calc(100% / 3);
    }
    .onvif {
        width: 100%;
        height: 100%;
    }
}
</style>